import Taro, { Component } from '@tarojs/taro'
import { AtIcon } from 'taro-ui'
import classnames from 'classnames'
import PropsType from 'prop-types'
import { View, Text, Image } from '@tarojs/components'
import '../styles/itementerprise.scss'

const itemEnterprise = require('./itementerprise.png')

export default class DItemEnterprise extends Component {

    render() {
        const {
            className,
            name = '广东道一车辆交易公司',
            list = ['广东省', '广州市'],
            phone = '联系方式：李立 13612323412',
            value = 'chevron-right'
        } = this.props
        return (
            <View className={classnames('b_itementerprise', className)}>
                <View className='b_itementerprise__left'>
                    <Image src={itemEnterprise} className='b_itementerprise__img'></Image>
                    <View className='b_itementerprise__item'>
                        {
                            name && <View className='b_itementerprise__item_name'>{name}</View>
                        }
                        {
                            list && <View className='b_itementerprise__item_addre'>
                                {
                                    list && list.map((item, key) => {
                                        return <Text key={key} className='item_addre__info'>{item}</Text>
                                    })
                                }
                            </View>
                        }
                        {
                            phone && <View className='b_itementerprise__item_phone'>{phone}</View>
                        }
                    </View>
                </View>
                {
                    value && <AtIcon value={value} color='#999999' size='25'></AtIcon>
                }
            </View>
        )
    }
}

DItemEnterprise.defaultProps = {
    className: "",
    name: "",
    list: [],
    phone: "",
    value: ""
}

DItemEnterprise.PropsType = {
    className: PropsType.oneOfType[PropsType.string, PropsType.object],
    name: PropsType.string,
    list: PropsType.array,
    phone: PropsType.string,
    value: PropsType.string
}